package com.catering.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 存储桌位相关信息的表
 * @TableName d_table_info
 */
@TableName(value ="d_table_info")
@Data
public class DTableInfo implements Serializable {
    /**
     * 自增长主键，唯一标识每条桌位记录
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 桌位编号
     */
    private String tableNumber;

    /**
     * 桌位名称，如大桌、中桌、小桌
     */
    private String tableName;

    /**
     * 可容纳人数
     */
    private String capacity;

    /**
     * 桌位状态，0表示未使用，1表示正在使用
     */
    private Integer status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DTableInfo other = (DTableInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTableNumber() == null ? other.getTableNumber() == null : this.getTableNumber().equals(other.getTableNumber()))
            && (this.getTableName() == null ? other.getTableName() == null : this.getTableName().equals(other.getTableName()))
            && (this.getCapacity() == null ? other.getCapacity() == null : this.getCapacity().equals(other.getCapacity()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTableNumber() == null) ? 0 : getTableNumber().hashCode());
        result = prime * result + ((getTableName() == null) ? 0 : getTableName().hashCode());
        result = prime * result + ((getCapacity() == null) ? 0 : getCapacity().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", tableNumber=").append(tableNumber);
        sb.append(", tableName=").append(tableName);
        sb.append(", capacity=").append(capacity);
        sb.append(", status=").append(status);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
